﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections.Specialized;
using System.Collections;

namespace Doo.WebUI.SiteBuilder.PropertyEditor
{
    public abstract class DropDownEditorBase : EditorBase
    {
        public override string ClientType
        {
            get { return "Doo.PageBuilder.PropertyEditor.DropDownEditor"; }
        }

        protected abstract Dictionary<string, string> GetDropItems();


        public override Hashtable Option
        {
            get
            {
                return new Hashtable
                    {
                        {"data",this.GetDropItems()}
                    };
            }
        }
    }

    /// <summary>
    /// 实现了下拉菜单的选择
    /// </summary>
    public class DropDownEditor : DropDownEditorBase
    {

        public DropDownEditor() { Items = new Dictionary<string, string>(); }

        /// <summary>
        /// 提供的项
        /// </summary>
        public virtual Dictionary<string, string> Items
        {
            get;
            set;
        }

        protected override Dictionary<string, string> GetDropItems()
        {
            return this.Items;
        }

    }
}
